<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="gcs.com.staticValue.StaticValue"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>定制单元监控页面</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<script type="text/javascript" src="jquery.min.js"></script>
	<script type="text/javascript">
		function saveConfig(){
			var url = $('#url').val();
			var ns = $('#ns').val();
			if(url==''){
				alert('后端webservice地址不能为空！');
			}else if(ns==''){
				alert('后端webservice命名空间不能为空！');
			}else{
				$.post('servlet/ConfigServlet', {url:url,ns:ns}, function(data){
							alert(data);
						}, 'html');
			}
		}
		
		function receiveMsg(){
			var contentReceiveValue =  $('#content').val();
			$.post('servlet/ReceiveMsgServlet', {}, function(data){
				contentReceiveValue = contentReceiveValue +data;
				$('#content').val(contentReceiveValue);
			}, 'html');
		}
		
		window.setInterval(receiveMsg, 1000); 
	</script>
  </head>
  
  <body>
  	<table width="700px">
  <tr>
  	<td width="180">后端webservice地址：</td><td><input type="text" style="width: 450px;" id="url" value="<%= StaticValue.getWebserviceUrl()%>"></td>
  </tr>	
  <tr>
  	<td>后端webservice命名空间：</td><td><input type="text" style="width: 120px;" id="ns" value="<%= StaticValue.getWebserviceNameSpace()%>"></td>
  </tr>
  <!-- 功能按钮  start-->
  	<tr><td colspan="4"><input type="button" onclick="saveConfig();" value="保存设置"/></td></tr>
  	<!-- 功能按钮  end-->
  	<tr>
  		<td colspan="4">
  			定制单元接收日志：
  		</td>
  	</tr>
  	<tr>
  		<td width="100%" colspan="4"><textarea id="content" style="width: 95%;height: 500px;"></textarea></td>
  	</tr>
  	</table>
  </body>
</html>
